import * as React from 'react';
import Head from 'next/head';
import { Spacer } from '@1milligram/design';

import { RelatedPatterns } from '../../components/RelatedPatterns';
import { Pattern } from '../../constants/Pattern';
import { PatternLayout } from '../../layouts/PatternLayout';
import BrowserFrame from '../../placeholders/BrowserFrame';

const Details: React.FC<{}> = () => {
    return (
        <PatternLayout pattern={Pattern.Avatar}>
            <Head>
                <meta name="description" content="Create an avatar component with CSS flexbox" />
                <meta name="og:description" content="Create an avatar component with CSS flexbox" />
                <meta name="twitter:description" content="Create an avatar component with CSS flexbox" />
                <meta name="keywords" content="css avatar, css flexbox" />
            </Head>
            <BrowserFrame
                html={`
<div class="avatar">
    <!-- Avatar image -->
    <img class="avatar__image" src="..." />
</div>
`}
                css={`
                    .avatar {
                        /* Rounded border */
                        border-radius: 50%;
                        height: 64px;
                        width: 64px;
                    }

                    .avatar__image {
                        /* Rounded border */
                        border-radius: 50%;

                        /* Take full size */
                        height: 100%;
                        width: 100%;
                    }
                `}
            >
                <div
                    style={{
                        alignItems: 'center',
                        display: 'flex',
                        flexDirection: 'column',
                        height: '100%',
                        justifyContent: 'center',
                        padding: '8px',
                    }}
                >
                    <div
                        style={{
                            backgroundColor: 'rgba(0, 0, 0, 0.3)',
                            borderRadius: '9999px',
                            height: '64px',
                            padding: '8px',
                            width: '64px',
                        }}
                    >
                        <svg
                            viewBox="0 0 24 24"
                            style={{
                                fill: 'none',
                                height: '100%',
                                stroke: '#FFF',
                                strokeLinecap: 'round',
                                strokeLinejoin: 'round',
                                strokeWidth: 1,
                                width: '100%',
                            }}
                        >
                            <path
                                d={`M12,3.5c2.347,0,4.25,1.903,4.25,4.25S14.347,12,12,12s-4.25-1.903-4.25-4.25S9.653,3.5,12,3.5z
                                M5,20.5
                                c0-3.866,3.134-7,7-7s7,3.134,7,7H5z`}
                            />
                        </svg>
                    </div>
                </div>
            </BrowserFrame>
            <Spacer size="extraLarge" />
            <RelatedPatterns patterns={[Pattern.AvatarList, Pattern.InitialAvatar, Pattern.PresenceIndicator]} />
        </PatternLayout>
    );
};

export default Details;
